##
$MU.setContext($CONTEXT)##
#set($TYPE = $model.name)
#set($type = $CSU.getVariable($TYPE))
#macro(label $obj)#if($obj.label)$obj.label#else$obj.name#end#end
##
#macro(newLine)

#end
##
#macro(jsCommentStart)
/*
#end
##
#macro(jsCommentEnd)
*/
#end
##
#macro(tab)	#end
##
#macro(checkConfig $vName, $model)
#trim("eachrow", 0, 'rn')
$vName = [
	#set($notFirst = false)
	#* required *#
	#set($checkJs = '')
	#foreach($field in $model.fields)
		#set($fieldLabel = '')
		#if($field.label)
			#set($fieldLabel = $field.label)
		#end
		#if(!$field.id && ($field.nullable.hashCode() && !$field.nullable))
			#if($notFirst),#else #set($notFirst = true) #end {"name":"$field.name","required":true,"tip":"${fieldLabel} 不能为空！"}
		#end
	#end

	#* format *#
	#foreach($field in $model.fields)
		#set($format = '')
		#set($fieldLabel = '')
		#if($field.label)
			#set($fieldLabel = $field.label)
		#end

		#if($field.type=='Short' || $field.type=='Integer' || $field.type=='Long')
			#set($format = 'Integer')
		#elseif($field.type=='Float' || $field.type=='Double')
			#set($format = 'Number')
		#elseif($field.type=='Date' || $field.type=='Timestamp')
			#set($format = 'Date')
		#end

		#if($field.format)
			#set($format = $field.format)
		#end

		#if($format && $format!='')
			#if($notFirst),#else #set($notFirst = true) #end {"name":"$field.name","format":"$format","tip":"$fieldLabel 格式错误!"}
		#end
	#end
];
#end
#end